import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter) // 注册路由插件

// 配置表
const routes = [
  {
	  path: '/Films',
	  component: ()=>import('../views/Films.vue'), //路由懒加载
	  redirect:'/films/Hot',
	  children:[{
		  path: '/films/Hot',
		  component:()=>import('../views/films/Hot.vue')
	  },
	  {
		  path:'/films/Soon',
		  component:()=>import('../views/films/Soon.vue')
	  }]
	},
	{
		path :'/Cinema',
		component: ()=>import('../views/Cinema.vue')
	},
	{
		path :'/Me',
		component: ()=>import('../views/Me.vue')
	},
	{
		path : '*',
		redirect:'/Films'
	},
	{
		path: '/Detail/:id',   //活期地址，只输入Detail不管用
		component: () => import('../views/Detail.vue')
	},
	{
		path: '/City',
		component: () => import('../views/City.vue')
	},
	{
		path: '/Search',
		component: () => import('../views/Search.vue')
	}
]

const router = new VueRouter({
  mode: 'history',
  // base: process.env.BASE_URL,
  routes
})

export default router
